﻿<%@ Page Language="C#" MasterPageFile="~/Client.master" AutoEventWireup="true" CodeFile="Giohang.aspx.cs"
    Inherits="Giohang" Title="Giỏ hàng" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .LinkButton1
        {
            text-decoration: none;
            color: Fuchsia;
        }
        .linkbutton
        {
            text-decoration: none;
            font-size: 15px;
            font-family: "Palatino Linotype";
            background-image: url('/Online/Img/a (2).jpg');
            padding: 5px;
            color: White;
            -webkit-border-radius: 3px;
            border-style: hidden;
            height: 30px;
            margin-top: 10px;
        }
        .linkbutton:hover
        {
            background-color: #829FB3;
            cursor: pointer;
        }
        .txt
        {
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="margin-bottom: 10px;">
        <div class="tieude2">
            Giỏ hàng
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="pnanel" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Font-Size="16px"
                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                    CellPadding="3" Width="824px" DataKeyNames="ID" OnRowDeleting="GridView1_RowDeleting">
                    <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" ForeColor="#000066" />
                    <Columns>
                        <asp:TemplateField HeaderText="Hình ảnh">
                            <ItemTemplate>
                                <asp:Image ID="img" runat="server" ImageUrl='<%#Eval("Hinhanh") %>' Width="80px"
                                    Height="80px" ToolTip='<%#Eval("Sanpham") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField Visible="true" HeaderText="Sản phẩm">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("ID")%>'
                                    Text='<%# Eval("Sanpham") %>' CssClass="LinkButton1"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Gia" DataFormatString="{0:0,000}VNĐ" HeaderText="Giá bán">
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Số lượng">
                            <ItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" MaxLength="3" CssClass="txt" Height="23px"
                                    Text='<%# Eval("Soluong") %>' Width="50px"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lbID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Tongtien" DataFormatString="{0:0,000} VNĐ" HeaderText="Thành tiền">
                        </asp:BoundField>
                        <asp:CommandField ShowDeleteButton="True" HeaderText="Xóa" DeleteText="Xóa" DeleteImageUrl="/2013/Img/del-product-cart.png" />
                    </Columns>
                    <EmptyDataTemplate>
                        Không có sản phẩm nào trong giỏ hàng của bạn!<br />
                        Click <a href="Default.aspx">vào đây</a> để lựa chọn sản phẩm.
                    </EmptyDataTemplate>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6EA1C0" Font-Bold="True" ForeColor="White" Height="40px" />
                </asp:GridView>
                <asp:Panel ID="pnTongTien" runat="server">
                    <div style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px hidden #CCCCCC;
                        border-bottom: 1px solid #CCCCCC; width: 821px; height: 25px; text-align: right;
                        font-family: Palatino Linotype; background-color: #FFFFFF; font-weight: bold;
                        color: Red;">
                        <div style="width: 600px; float: left;">
                            <span>Tổng thanh toán : </span>
                        </div>
                        <div style="float: left;">
                            <span style="margin-left: 10px;">
                                <asp:Label ID="Sum" runat="server"></asp:Label></span>
                        </div>
                    </div>
                    <asp:Button ID="Update" runat="server" Text="Cập nhật" CssClass="linkbutton" OnClick="Update_Click" />
                    <asp:Button ID="Tiep" runat="server" Text="Tiếp tục mua" CssClass="linkbutton" OnClick="Tiep_Click" />
                    <asp:Button ID="btnDatHang" runat="server" Text="Đặt hàng" CssClass="linkbutton" ValidationGroup="Them"
                        OnClick="btnDatHang_Click" />
                </asp:Panel>
                <asp:Panel ID="pnDatHang" runat="server">
                <div class="tieude2" style="margin-top: 10px;">
                    Thông tin đặt hàng
                </div>
                <div style="margin-top: 10px; margin-bottom: 10px;">
                    <table width="100%">
                        <tr>
                            <td>
                                Họ tên khách hàng
                            </td>
                            <td>
                                <asp:TextBox ID="txtHoTen" runat="server" Width="400px"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator5" runat="server"
                            ControlToValidate="txtHoTen" ErrorMessage="Nhập họ tên" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Địa chỉ nhận hàng
                            </td>
                            <td>
                                <asp:TextBox ID="txtDiaChi" runat="server" Width="400px"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="txtDiaChi" ErrorMessage="Nhập địa chỉ" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Số điện thoại
                            </td>
                            <td>
                                <asp:TextBox ID="txtSoDienThoai" runat="server" Width="400px"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="txtSoDienThoai" ErrorMessage="Nhập số điện thoại" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmail" runat="server" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Yêu cầu giao hàng
                            </td>
                            <td>
                                <asp:TextBox ID="txtYeuCau" TextMode="MultiLine" Rows="10" runat="server" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                </asp:Panel>
                <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                    ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                    runat="server" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Update" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="pro" runat="server" AssociatedUpdatePanelID="pnanel">
        </asp:UpdateProgress>
    </div>
</asp:Content>
